# -*- coding: utf-8 -*-

from odoo_contrib.exceptions import BaseOdooException


class FrontendException(BaseOdooException):
    # category
    # frontend: 20
    category = 'frontend'

    # sub category
    #   - checkin.specify_salesman 01
    #   - article.entry 02
    #   - exhibit.entry 03
    #   - exhibit.entry.visit 06
    #   - favourites.exhibit.add 04
    #   - favourites.exhibit.revoke 05

    co_msg_mapping = {
        200101: {
            'message': 'Specified checkin not exists',
            'http_code': 404,
            'sub_category': 'checkin.specify_salesman'
        },
        200102: {
            'message': 'Specified salesman not exists',
            'http_code': 404,
            'sub_category': 'checkin.specify_salesman'
        },
        200201: {
            'message': 'Specified article not exists',
            'http_code': 404,
            'sub_category': 'article.entry'
        },
        200301: {
            'message': 'Specified exhibit not exists',
            'http_code': 404,
            'sub_category': 'exhibit.entry'
        },
        200401: {
            'message': 'Specified exhibit not exists',
            'http_code': 404,
            'sub_category': 'favourites.exhibit.add'
        },
        200501: {
            'message': 'Specified exhibit not in your favourites',
            'http_code': 404,
            'sub_category': 'favourites.exhibit.add'
        },
        200601: {
            'message': 'Specified exhibit not exists',
            'http_code': 404,
            'sub_category': 'exhibit.entry.visit'
        },
        200650: {
            'message': 'Unexpected exception',
            'http_code': 500,
            'sub_category': 'exhibit.entry.visit'
        },
    }
